# Importing Data
EUROPE<- read_excel("C:/users/Biniam/Desktop/Documents/Academic/Thesis/Analysis Folder/Excel Files/Plastic/Plastics.xlsx",sheet = "Sheet3", range = "c1:c70")

# Checking the Imported Data
View(EUROPE)
# Creating Time Series Data
EUROPE_ts <- ts(EUROPE, start=c(1950), end=c(2018), frequency=1)
# Viewing and Checking the Created Time Series Data
EUROPE_ts


# Identification: Plotting the Time Series Data
plot(EUROPE_ts)

# Estimating the appropriate model
EUROPE_ts_model <- auto.arima(EUROPE_ts)
EUROPE_ts_model

# Forecasting
options(max.print=1000000)
EUROPE_ts_forecast <- forecast (EUROPE_ts_model, level=c(95), h=22)
plot(EUROPE_ts_forecast)
EUROPE_ts_forecast             

# Exporting
write.table(EUROPE_ts_forecast, file="/users/Biniam/Desktop/Documents/Academic/Thesis/Result Folder/TSA Results/Excel Files/From R/Plastic/EUROPE_TSA.csv", sep=",")


